<template>
  <div>
    <h1>vue3</h1>
    <h2>{{ age }}</h2>
    <p>1111111111111</p>
    <h3>{{type}}|{{price}}</h3>
    <button @click="add()">按钮</button>
    <button @click="fn()">按钮</button>
  </div>
</template>
<script lang="ts">
import { reactive, ref, toRefs } from 'vue';
// import { h } from 'vue';

export default {
  // name:"张三",
  setup() {
    let age = ref(18);
    function add() {
      console.log(1111);
    }
    let other = reactive({
      type:"人民币",
      price:100
    })

    let arr = [1,2,3,5,6]
    function fn(){
      age.value  = 20
      // console.log(`${arr}+${age}`);
      other.price = 200
    }
    // torefs可以把响应式对象转换成独立的ref对象
    return { add, age,fn,...toRefs(other)};
    //  return () => {return h("p","一一一一一一一一一一")}
  },
};
</script>
<style>
</style>

